//
//  Nsdataencryption.m
//  图片加密解密
//
//  Created by Bindx on 14-2-13.
//  Copyright (c) 2014年 Bindx. All rights reserved.
//

#import "Nsdataencryption.h"

@implementation Nsdataencryption



+ (NSString *)inputNsdataEncryption:(NSData*)iptData
{
    NSString * beforeCode = nil;
    NSString * beforeCodeRemaining = nil;
    NSString * after = nil;
    NSString * tmp = nil;
    NSString * tmp2 = @"";
    //1 把_data转成base64
    NSString *_encodedImageStr = [iptData base64EncodedStringWithOptions:0];
    //1.1 截取1000个字符进行加密
    beforeCode = [_encodedImageStr substringToIndex:1000];
    //1.1 截取剩下的字符
    beforeCodeRemaining = [_encodedImageStr substringFromIndex:1000];
    //2对截取的字符进行加密
    tmp = [PassWord enPassWord:beforeCode dlegate:self];
    after = [tmp2 beforeCods:tmp afterCode:beforeCodeRemaining];
    return after;
}

+ (NSString *)inputNsdataDecryption:(NSString*)iptData
{
    NSString * afterCode = @"";
    NSString * s1 = @"";
    afterCode = [s1 completes:iptData];
    return afterCode;
}

@end
